Skip to content

test: raise encoder/decoder coverage (10 lowest-coverage classes)#115

Merged
dfa1 merged 11 commits into
mainfrom
test/encoder-decoder-coverage
Jun 21, 2026
Merged

test: raise encoder/decoder coverage (10 lowest-coverage classes)#115
dfa1 merged 11 commits into
mainfrom
test/encoder-decoder-coverage

Conversation

@dfa1

@dfa1 dfa1 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Adds tests for the ten lowest-coverage encoder/decoder classes (per SonarCloud, encode/decode files only), one file per commit, climbing from lowest coverage. Test-only — no production code changed.

Commit Target Was Added
C1 ZigZagEncodingDecoder 46% decode + single-value broadcast per width (I8/I16/I32/I64), accepts, non-primitive throw
C2 SequenceEncodingEncoder 61% int/float widths (incl. unsigned scalar branch), empty/single-element, non-arithmetic throws
C3 VariantEncodingDecoder 36% every dtypeFromProto arm (null/bool/decimal/utf8/binary/struct/list/fsl/extension/variant + unsupported throw)
C4 ZigZagEncodingEncoder 60% I8/I16 encode arms, accepts, encodingId
C5 TimeExtensionEncoder 63% dtype factories, all four valid units, nullable null handling, non-nullable + Days guards
C6 VarBinViewEncodingDecoder 63% guards (wrong dtype, zero buffers), Binary-dtype inline-view decode
C7 VarBinEncodingDecoder 66% I32 offsets, constant-offset broadcast-copy
C8 AlpEncodingDecoder 66% f64/f32 constant broadcast, missing-meta fallback, U8 patch-index arm, non-unsigned-index throw
C9 DateTimePartsEncodingDecoder 67% Days special case, nullable child, missing-metadata + non-Extension throws
C10 DeltaEncodingDecoder 69% meta==null empty fallback (all ptypes), readLongs constant broadcast

"Was" figures are from a stale SonarCloud snapshot; the real gaps were verified against current source.

Defensive unreachable branches (exhaustive-switch default -> throws, malformed-proto IOException catches) left untested per the repo's simplify-first rule — not worth unkillable tests.

Full reader + writer suite green: 1569 tests, 0 failures.

🤖 Generated with Claude Code

dfa1 and others added 11 commits June 21, 2026 08:14
Was 46% line coverage with no dedicated test. Adds round-trips for
I8/I16/I32/I64 (incl. MIN/MAX bounds), the single-value broadcast path
per width, accepts/encodingId, and the non-primitive-dtype throw.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 61% line coverage. Adds accepts, encode round-trips for
I8/I16/I32/U16/U64/F32 (covering the byte/short/int readLong branches
and the unsigned buildIntScalar branch), empty + single-element cases,
and non-arithmetic throws for F32/F64/F16.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 36% line coverage — only the primitive arm of the proto-to-core
DType translation was exercised. Adds a DtypeFromProto nested class
covering null/bool/decimal/utf8/binary/struct/list/fixed_size_list/
extension (with and without metadata bytes)/variant, plus the
unsupported-empty-proto throw.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 60% line coverage — only the I32/I64 encode arms were exercised.
Adds I8 and I16 round-trips (incl. MIN/MAX bounds and empty), plus
encodingId and accepts (signed true; unsigned/non-primitive false).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 63% line coverage with no writer-side test. Covers extensionId,
dtype factories (default ms/I32, seconds/I32, nanos/I64), encodeAll for
all four valid units (int[] for s/ms, long[] for us/ns), nullable null
handling (NullableData + zero placeholder), the non-nullable null throw,
and the Days-unit rejection guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 63% line coverage — the encoder round-trip tests only drive the
Utf8 happy path. Adds encodingId, accepts, the Binary-dtype inline-view
decode, and both guard throws (wrong dtype, zero buffers).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 66% line coverage — the encoder round-trips only drive I64 offsets
and never hit the constant-offset broadcast path. Adds an I32 offsets
happy path and the single-offset broadcast-copy case (capacity < n+1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 66% line coverage — the encoder round-trips only drive the dense
U32-indexed paths. Adds accepts, the non-primitive-dtype throw, the
missing-metadata zero-exponent fallback, f64/f32 constant-broadcast
(capacity < n, no patches), a U8 patch-index decode (readUnsigned U8
arm), and the non-unsigned patch-index-ptype rejection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Was 67% line coverage — encoder round-trips only drive non-null ms/ns/us
timestamps. Adds encodingId, missing-metadata throw, the Days-unit
special case (unitsPerSecond=1), the nullable-extension days child, the
extension-missing-TimeUnit throw, and the non-Extension-dtype throw.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The encoder property test drives the dense ptype/size matrix but always
emits metadata and full-length children. Adds the meta==null empty-array
fallback (every integer ptype) and the readLongs broadcast path where
bases/deltas children hold a single constant value (capacity < count).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Arena.global() never frees; ofAuto() is GC-backed and matches the
VarBinView test in the same series.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 59ec2e2 into main Jun 21, 2026
@dfa1 dfa1 deleted the test/encoder-decoder-coverage branch June 21, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant